package zunyi04;

/**
 * 工人类
 */
public class Worker {
    private int id;
    private String name;
    private int age;
    private double salary;

    //无参构造
    public Worker() {
    }

    //有参构造
    public Worker(int id, String name, int age, double salary) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.salary = salary;
    }
    public void work(){
        Worker worker = new Worker();
        System.out.println(name+"工作8小时");
    }

    public void work(int hours){
        System.out.println(name+" 工作 "+hours+" 小时");
    }


}
